<html>
<head><meta charset="utf-8"><title>loop labels have weird scoping · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/loop.20labels.20have.20weird.20scoping.html">loop labels have weird scoping</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="223961328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/loop%20labels%20have%20weird%20scoping/near/223961328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/loop.20labels.20have.20weird.20scoping.html#223961328">(Jan 25 2021 at 21:15)</a>:</h4>
<p><a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=eb23416ed3d57e1570099bf1c1cdeedc">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=eb23416ed3d57e1570099bf1c1cdeedc</a></p>



<a name="223961405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/loop%20labels%20have%20weird%20scoping/near/223961405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/loop.20labels.20have.20weird.20scoping.html#223961405">(Jan 25 2021 at 21:16)</a>:</h4>
<p>I think i've asked about this before, but why on earth does this generate a warning about duplicate labels in the same scope?</p>



<a name="223984653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/loop%20labels%20have%20weird%20scoping/near/223984653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/loop.20labels.20have.20weird.20scoping.html#223984653">(Jan 26 2021 at 00:53)</a>:</h4>
<p>I was looking at this when working on the namespace chapter.  I think there was a plan to have lifetime and loop labels in the same namespace, and are scoped for the entire function.  Also, there was a plan to allow labels on blocks.  See <a href="https://github.com/rust-lang/rust/pull/24162">https://github.com/rust-lang/rust/pull/24162</a> and the linked internals thread.</p>



<a name="224142309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/loop%20labels%20have%20weird%20scoping/near/224142309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/loop.20labels.20have.20weird.20scoping.html#224142309">(Jan 27 2021 at 05:34)</a>:</h4>
<p>Ah, <span class="user-mention" data-user-id="116083">@pnkfelix</span> did that plan for loop labels ever go anywhere?</p>



<a name="224147463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/loop%20labels%20have%20weird%20scoping/near/224147463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/loop.20labels.20have.20weird.20scoping.html#224147463">(Jan 27 2021 at 07:23)</a>:</h4>
<p>I hold out hope that this is future-proofing for <code>goto 'a</code> <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="224217107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/loop%20labels%20have%20weird%20scoping/near/224217107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/loop.20labels.20have.20weird.20scoping.html#224217107">(Jan 27 2021 at 17:33)</a>:</h4>
<p>heh, <a href="https://github.com/rust-lang/rust/issues/24162">#24162</a> is truly ancient</p>



<a name="224217510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/loop%20labels%20have%20weird%20scoping/near/224217510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/loop.20labels.20have.20weird.20scoping.html#224217510">(Jan 27 2021 at 17:36)</a>:</h4>
<p>Its hard to say whether its going to go anywhere. labeling blocks was always an imperfect model, and now with NLL, it is even more imperfect.</p>



<a name="224265768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/loop%20labels%20have%20weird%20scoping/near/224265768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/loop.20labels.20have.20weird.20scoping.html#224265768">(Jan 27 2021 at 23:46)</a>:</h4>
<p>well can we at least disable the absolutely nonsensical warnings?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>